package net.csdn.business.common.feign.oauth2;



import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import net.csdn.business.common.constant.ServiceNameConstants;
import net.csdn.business.common.domain.request.oauth.GatewayRouteInfoQuery;
import net.csdn.business.common.domain.request.oauth.NewGatewayRouteInfoDTO;
import net.csdn.business.common.domain.request.oauth.UpdateGatewayRouteInfoDTO;
import net.csdn.business.common.domain.vo.oauth.GatewayRouteInfoVO;
import net.csdn.business.common.feign.oauth2.config.AuthFeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


/**
 * @Desc: auth服务提供openApi网关路由相关接口
 * @Author: zhangyalei
 * @Date: 2022/12/19 13:51
 */
@FeignClient(value = ServiceNameConstants.ATOMGIT_AUTH_SERVICE,contextId = ServiceNameConstants.ATOMGIT_AUTH_GATEWAY_ROUTE_CONTEXT_ID, configuration = AuthFeignConfiguration.class)
public interface AuthGatewayRouteFeignClient {

	/**
	 * 分页查询网关路由信息
	 *
	 * @param query 网关路由信息详细信息
	 * @return 网关路由信息
	 */
	@PostMapping("/api/v1/route/list")
	public Page<GatewayRouteInfoVO> findPageList(@RequestBody GatewayRouteInfoQuery query);


	/**
	 * 根据id查询网关路由信息详细信息
	 *
	 * @param id 网关路由信息主键
	 * @return 网关路由信息
	 */
	@GetMapping("/api/v1/route/{id}")
	public GatewayRouteInfoVO getById(@PathVariable("id") Long id);


	/**
	 * 新增网关路由信息
	 *
	 * @param params 网关路由信息
	 * @return 结果
	 */
	@PostMapping("/api/v1/route/add")
	public Integer addGatewayRoute(@RequestBody NewGatewayRouteInfoDTO params);

	/**
	 * 修改网关路由信息
	 *
	 * @param params 网关路由信息
	 * @return 结果
	 */
	@PostMapping("/api/v1/route/update")
	public Integer updateGatewayRoute(@RequestBody UpdateGatewayRouteInfoDTO params);



	/**
	 * 根据id删除网关路由信息信息
	 * @param id
	 * @return
	 */
	@DeleteMapping("/api/v1/route/{id}")
	public Integer deleteGatewayRoute(@PathVariable("id") Long id);


}
